home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / doc / interpreter / image.tex < prev    next >
Text File  |  1997-08-13  |  5KB  |  139 lines

  1. @c Copyright (C) 1996, 1997 John W. Eaton
  2. @c This is part of the Octave manual.
  3. @c For copying conditions, see the file gpl.tex.
  4.  
  5. @node Image Processing, Audio Processing, Signal Processing, Top
  6. @chapter Image Processing
  7.  
  8. Octave can display images with the X Window System using the
  9. @code{xloadimage} program.  You do not need to be running X in order to
  10. manipulate images, however, so some of these functions may be useful
  11. even if you are not able to view the results.
  12.  
  13. Loading images only works with Octave's image format (a file with a
  14. matrix containing the image data, and a matrix containing the
  15. colormap).  Contributions of robust, well-written functions to read
  16. other image formats are welcome.  If you can provide them, or would like
  17. to improve Octave's image processing capabilities in other ways, please
  18. contact @email{bug-octave@@bevo.che.wisc.edu}.
  19.  
  20. @deftypefn {Function File} {} colormap (@var{map})
  21. @deftypefnx {Function File} {} colormap ("default")
  22. Set the current colormap.
  23.  
  24. @code{colormap (@var{map})} sets the current colormap to @var{map}.  The
  25. color map should be an @var{n} row by 3 column matrix.  The columns
  26. contain red, green, and blue intensities respectively.  All entries
  27. should be between 0 and 1 inclusive.  The new colormap is returned.
  28.  
  29. @code{colormap ("default")} restores the default colormap (a gray scale
  30. colormap with 64 entries).  The default colormap is returned.
  31.  
  32. With no arguments, @code{colormap} returns the current color map.
  33. @end deftypefn
  34.  
  35. @deftypefn {Function File} {} gray (@var{n})
  36. Return a gray colormap with @var{n} entries corresponding to values from
  37. 0 to @var{n}.  The argument @var{n} should be a scalar.  If it is
  38. omitted, 64 is assumed.
  39. @end deftypefn
  40.  
  41. @deftypefn {Function File} {[@var{img}, @var{map}] =} gray2ind (@var{})
  42. Convert a gray scale intensity image to an Octave indexed image.
  43. @end deftypefn
  44.  
  45. @deftypefn {Function File} {} image (@var{x}, @var{zoom})
  46. Display a matrix as a color image.  The elements of @var{x} are indices
  47. into the current colormap and should have values between 1 and the
  48. length of the colormap.  If @var{zoom} is omitted, a value of 4 is
  49. assumed. 
  50. @end deftypefn
  51.  
  52. @deftypefn {Function File} {} imagesc (@var{x}, @var{zoom})
  53. Display a scaled version of the matrix @var{x} as a color image.  The
  54. matrix is scaled so that its entries are indices into the current
  55. colormap.  The scaled matrix is returned.  If @var{zoom} is omitted, a
  56. value of 4 is assumed.
  57. @end deftypefn
  58.  
  59. @deftypefn {Function File} {} imshow (@var{x}, @var{map})
  60. @deftypefnx {Function File} {} imshow (@var{x}, @var{n})
  61. @deftypefnx {Function File} {} imshow (@var{i}, @var{n})
  62. @deftypefnx {Function File} {} imshow (@var{r}, @var{g}, @var{b})
  63. Display images.
  64.  
  65. @code{imshow (@var{x})} displays an indexed image using the current
  66. colormap.
  67.  
  68. @code{imshow (@var{x}, @var{map})} displays an indexed image using the
  69. specified colormap.
  70.  
  71. @code{imshow (@var{i}, @var{n})} displays a gray scale intensity image.
  72.  
  73. @code{imshow (@var{r}, @var{g}, @var{b})} displays an RGB image.
  74. @end deftypefn
  75.  
  76. @deftypefn {Function File} {} ind2gray (@var{x}, @var{map})
  77. Convert an Octave indexed image to a gray scale intensity image.
  78. If @var{map} is omitted, the current colormap is used to determine the
  79. intensities.
  80. @end deftypefn
  81.  
  82. @deftypefn {Function File} {[@var{r}, @var{g}, @var{b}] =} ind2rgb (@var{x}, @var{map})
  83. Convert an indexed image to red, green, and blue color components.
  84. If @var{map} is omitted, the current colormap is used for the conversion.
  85. @end deftypefn
  86.  
  87. @deftypefn {Function File} {[@var{x}, @var{map}] =} loadimage (@var{file})
  88. Load an image file and it's associated color map from the specified
  89. @var{file}.  The image must be stored in Octave's image format.
  90. @end deftypefn
  91.  
  92. @deftypefn {Function File} {} rgb2ntsc (@var{rgb})
  93. Image format conversion.
  94. @end deftypefn
  95.  
  96. @deftypefn {Function File} {} ntsc2rgb (@var{yiq})
  97. Image format conversion.
  98. @end deftypefn
  99.  
  100. @deftypefn {Function File} {} ocean (@var{n})
  101. Create color colormap.  The argument @var{n} should be a scalar.  If it
  102. is omitted, 64 is assumed.
  103. @end deftypefn
  104.  
  105. @deftypefn {Function File} {[@var{x}, @var{map}] =} rgb2ind (@var{r}, @var{g}, @var{b})
  106. Convert and RGB image to an Octave indexed image.
  107. @end deftypefn
  108.  
  109. @deftypefn {Function File} {} saveimage (@var{file}, @var{x}, @var{fmt}, @var{map})
  110. Save the matrix @var{x} to @var{file} in image format @var{fmt}.  Valid
  111. values for @var{fmt} are
  112.  
  113. @table @code
  114. @item "img"
  115. Octave's image format.  The current colormap is also saved in the file.
  116.  
  117. @item "ppm"
  118. Portable pixmap format.
  119.  
  120. @item "ps"
  121. PostScript format.  Note that images saved in PostScript format can not
  122. be read back into Octave with loadimage.
  123. @end table
  124.  
  125. If the fourth argument is supplied, the specified colormap will also be
  126. saved along with the image.
  127.  
  128. Note: if the colormap contains only two entries and these entries are
  129. black and white, the bitmap ppm and PostScript formats are used.  If the
  130. image is a gray scale image (the entries within each row of the colormap
  131. are equal) the gray scale ppm and PostScript image formats are used,
  132. otherwise the full color formats are used.
  133. @end deftypefn
  134.  
  135. @defvr {Built-in Variable} IMAGEPATH            
  136. A colon separated list of directories in which to search for image
  137. files.
  138. @end defvr
  139.